package com.MIIS;

import com.MIIS.InfoView.InfoView;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.widget.Button;
import android.view.*;

public class MIIS extends Activity implements View.OnClickListener {
	Button infoViewButton;
	Button regiViewButton;
	Button hwViewButton;
	
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        
        //buttons - indicate 3 main activities
        infoViewButton = (Button)findViewById(R.id.go_infoView_button);
        regiViewButton = (Button)findViewById(R.id.go_regiView_button);
        hwViewButton = (Button)findViewById(R.id.go_hwView_button);
        
        //set buttons with click listener
        infoViewButton.setOnClickListener(this);
        regiViewButton.setOnClickListener(this);
        hwViewButton.setOnClickListener(this);
    }

    //click listener's override method
	public void onClick(View v) {
		//if the first button is clicked
		if( v.equals(infoViewButton) ) {
			//set a new activity with the class InfoView
			Intent infoIntent = new Intent(this, InfoView.class);
			//starts the activity
			startActivity(infoIntent);
			
			//transition animation activated
			overridePendingTransition(R.anim.push_left_in, R.anim.push_left_out);
			//finish/destroy the current activity
			finish();
		}
	}
}